<template>
  <div class="bg-white p-[20px]">
    <div class="text-l font-bold mb-4">开户信息</div>
    <div class="item">
      <div class="item-label">进件类型</div>
      <div class="item-value">{{ detail.type == 1 ? "个人" : "企业" }}</div>
    </div>
    <div class="item">
      <div class="item-label">个人证件类型</div>
      <div class="item-value">{{ detail.idCardType }}</div>
    </div>
    <div class="item">
      <div class="item-label">个人证件号码</div>
      <div class="item-value">{{ detail.idCardNo }}</div>
    </div>
    <div class="item">
      <div class="item-label">个人证件有效期类型</div>
      <div class="item-value">{{ detail.idCardValidType }}</div>
    </div>
    <div class="item">
      <div class="item-label">个人证件有效期开始日期</div>
      <div class="item-value">{{ detail.idCardValidStartTime }}</div>
    </div>
    <div class="item">
      <div class="item-label">个人证件有效期截止日期</div>
      <div class="item-value">{{ detail.idCardValidEndTime }}</div>
    </div>
    <div class="item">
      <div class="item-label">个人姓名</div>
      <div class="item-value">{{ detail.name }}</div>
    </div>
    <div class="item">
      <div class="item-label">个人手机号</div>
      <div class="item-value">{{ detail.mobile }}</div>
    </div>
    <div class="text-l font-bold mb-4">业务入驻信息</div>
    <div class="item">
      <div class="item-label">业务入驻状态</div>
      <div class="item-value">
        {{ detail.businessStatus == 1 ? "已入驻" : "未入驻" }}
      </div>
    </div>
    <div class="item">
      <div class="item-label">结算账号</div>
      <div class="item-value">{{ detail.bankCardNo }}</div>
    </div>
    <div class="item">
      <div class="item-label">银行所在省市</div>
      <div class="item-value">
        {{ detail.bankProvince }}
      </div>
    </div>
    <div class="item">
      <div class="item-label">联系人身份证正面照片(国徽面)</div>
      <div class="item-value">
        <span v-if="!detail.idFrontPic">无</span>
        <el-image v-else :src="detail.idFrontPic" />
      </div>
    </div>
    <div class="item">
      <div class="item-label">联系人身份证反面照片(人像面)</div>
      <div class="item-value">
        <span v-if="!detail.idBackPic">无</span>
        <el-image v-else :src="detail.idBackPic" />
      </div>
    </div>
    <div class="item">
      <div class="item-label">结算卡正面照片</div>
      <div class="item-value">
        <span v-if="!detail.bankCardBeforePic">无</span>
        <el-image v-else :src="detail.bankCardBeforePic" />
      </div>
    </div>
    <div class="item">
      <div class="item-label">结算卡反面照片</div>
      <div class="item-value">
        <span v-if="!detail.bankCardBehindPic">无</span>
        <el-image v-else :src="detail.bankCardBehindPic" />
      </div>
    </div>
    <div class="item">
      <div class="item-label">结算周期</div>
      <div class="item-value">{{ detail.settlementCycle }}</div>
    </div>
    <div class="bottom">
      <el-button @click="router.go(-1)">返回</el-button>
    </div>
  </div>
</template>

<script setup lang="ts">
import HFAPI from "@/api/hf";

const detail = ref({});
const route = useRoute();

const router = useRouter();

HFAPI.getDetail(route.query.id as string).then((res) => {
  detail.value = res;
});
</script>

<style lang="scss" scoped>
.item {
  display: flex;
  gap: 20px;
  padding: 20px 0;
  &-label {
    width: 300px;
    flex-shrink: 0;
    text-align: right;
    font-weight: 400;
  }
  &-value {
    flex: 1;
  }
}
.bottom {
  width: 100%;
  position: fixed;
  background-color: #fff;
  bottom: 0;
  left: 0;
  height: 60px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0px -2px 5px 0px rgba(0, 0, 0, 0.01);
}
</style>
